﻿Imports extremo

Public Class ReservasEliminar
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim id = Request.Params.Get("id")

        Dim negocio = New ReservaNegocio
        Dim modelo = negocio.obtener(id)

        Me.txtidreserva.Value = modelo.idreserva
        Me.txtDeporte.Text = modelo.deporte
        Me.txtFecha.Text = modelo.fecha_reserva

    End Sub

    Protected Sub btnEliminar_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnEliminar.Click
        Try
            Dim negocio = New ReservaNegocio
            negocio.eliminar(Me.txtidreserva.Value)
            Response.Redirect("Reservas.aspx", True)
        Catch ex As Exception
            Response.Write("No se pudo eliminar")
        End Try
    End Sub

    Protected Sub btnRegresar_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnRegresar.Click
        Response.Redirect("Reservas.aspx", True)
    End Sub
End Class